//
//  BaseUIViewController.m
//  Project
//
//  Created by  CarlsonLee on 2018/12/6.
//  Copyright © 2018年 YANJING. All rights reserved.
//

#import "BaseUIViewController.h"

@interface BaseUIViewController ()

@end

@implementation BaseUIViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.fd_interactivePopMaxAllowedInitialDistanceToLeftEdge = 50;
    [self.view setBackgroundColor:ColorFromRGB(0xffffff)];
    
    [self p_initData];
    [self p_initSubViews];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
}

#pragma mark - 🔒private

- (void)p_initData{}

- (void)p_initSubViews{}

#pragma mark - 🔄overwrite
- (void)base_requestHeaderToRefresh{}

- (void)base_requestFooterToRefresh{}

#pragma mark - 🚪public

#pragma mark - 🍐delegate

#pragma mark - TableView Delegate and DataSource

#pragma mark - ☎️notification

#pragma mark - 🎬event response

#pragma mark - ☸getter and setter
- (MJRefreshGifHeader *)gifTableHeader
{
    if(!_gifTableHeader){
        _gifTableHeader = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(base_requestHeaderToRefresh)];
        NSArray* pullArray = [CommonTool ct_creatImageArrWithBaseStr:@"" beginIdx:0 endIdx:1];
        NSArray* circleArray = [CommonTool ct_creatImageArrWithBaseStr:@"" beginIdx:0 endIdx:1];
        [_gifTableHeader setImages:pullArray forState:MJRefreshStateIdle];
        [_gifTableHeader setImages:@[[pullArray lastObject]] forState:MJRefreshStatePulling];
        [_gifTableHeader setImages:circleArray forState:MJRefreshStateRefreshing];
        _gifTableHeader.lastUpdatedTimeLabel.hidden = YES;
        _gifTableHeader.stateLabel.hidden = YES;
    }
    return _gifTableHeader;
}

- (MJRefreshBackGifFooter *)gifTableFooter
{
    if(!_gifTableFooter){
        _gifTableFooter = [MJRefreshBackGifFooter footerWithRefreshingTarget:self refreshingAction:@selector(base_requestFooterToRefresh)];
        
    }
    return _gifTableFooter;
}

@end
